document.addEventListener('DOMContentLoaded',function(){
  var likesbtn = document.getElementById('likes-btn')
  var likesnum = document.getElementById('likesnum')
  likesbtn.addEventListener('click',function(){
    fetch('/images/likes/' + likesbtn.dataset.imageid,
      {method:'POST',body:{}}
    ).then(Response => Response.json())
    .then(resp=>{
      console.log(resp)
      likesnum.innerHTML = resp.likes
    })
  })
})